﻿namespace CRM.Database.Model
{
    public partial class TechnicRequestsProductSystems : IGetKeyValue
    {
        #region Implementation of IGetKeyValue

        /// <summary>
        /// локализованное имя
        /// </summary>
        public string ProductSystemNameLocalizedExt
        {
            get
            {
                var productSystemsCol = new ProductSystemsCollection();
                var productSystem = (ProductSystems) productSystemsCol.GetItemById(IdProductSystem);
                return productSystem == null ? " " : productSystem.LocalizedName;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public string ProductMarkExt
        {
            get
            {
                if (ProductSystems.ProductMarks != null)
                {
                    return ProductSystems.ProductMarks.ProductMark;
                }
                return " ";
            }
        }

        /// <summary>
        /// Получение ключего значения элемента
        /// </summary>
        /// <returns>Ключевое значение</returns>
        public int GetKeyValue()
        {
            return IdTechnicRequestsProductSystem;
        }

        #endregion
    }
}